class SearchModel {
  final List<SearchItem>? data;
  String? keyword;

  SearchModel({this.data, this.keyword});

  factory SearchModel.fromJson(Map<String, dynamic> json) {
    var dataJson = json['data'] as List;
    List<SearchItem> data =
        dataJson.map((i) => SearchItem.fromJson(i)).toList();
    return SearchModel(data: data);
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = <String, dynamic>{};
    if (this.data != null) {
      data['data'] = this.data!.map((v) => v.toJson()).toList();
    }
    return data;
  }
}

class SearchItem {
  final String? code;
  final String? word;
  final String? type;
  final String? districtname;
  final String? url;
  final String? imageUrl;
  final String? subImageUrl;
  final bool? isBigIcon;
  final String? sourceType;
  final String? price;
  final String? zonename;
  final String? star;

  SearchItem(
      {this.code,
      this.word,
      this.type,
      this.districtname,
      this.url,
      this.imageUrl,
      this.subImageUrl,
      this.isBigIcon,
      this.sourceType,
      this.price,
      this.zonename,
      this.star});

  factory SearchItem.fromJson(Map<String, dynamic> json) {
    return SearchItem(
      code: json['code'],
      word: json['word'],
      type: json['type'],
      districtname: json['districtname'],
      url: json['url'],
      imageUrl: json['imageUrl'],
      subImageUrl: json['subImageUrl'],
      isBigIcon: json['isBigIcon'],
      sourceType: json['sourceType'],
      price: json['price'],
      zonename: json['zonename'],
      star: json['star'],
    );
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = <String, dynamic>{};
    data['code'] = code;
    data['word'] = word;
    data['type'] = type;
    data['districtname'] = districtname;
    data['url'] = url;
    data['imageUrl'] = imageUrl;
    data['subImageUrl'] = subImageUrl;
    data['isBigIcon'] = isBigIcon;
    data['sourceType'] = sourceType;
    data['price'] = price;
    data['zonename'] = zonename;
    data['star'] = star;
    return data;
  }
}
